limsQualitycontrolTestResult.editPage = {
    datas: {
        baseChartData: {
            "title": "XXX走势图", "markLineList": [{
                "name": "-3SD", "lineStyle": {
                    "color": "#ff6550"
                }, "lineData": 1
            }, {
                "name": "-2SD", "lineStyle": {
                    "color": "#fbdb0f"
                }, "lineData": 2
            }, {
                "name": "-SD", "lineStyle": {
                    "color": "#5ad8a6"
                }, "lineData": 3
            }, {
                "name": "X", "lineStyle": {
                    "color": "#ddd"
                }, "lineData": 4
            }, {
                "name": "+SD", "lineStyle": {
                    "color": "#5ad8a6"
                }, "lineData": 5
            }, {
                "name": "+2SD", "lineStyle": {
                    "color": "#fbdb0f"
                }, "lineData": 6
            }, {
                "name": "+3SD", "lineStyle": {
                    "color": "#ff6550"
                }, "lineData": 7
            }], sourceList: []
        }
    },

    getGridParamGroupByProductCode: function () {
        var _this = this;
        return {
            type: 'grid',
            id: 'lims-qualitycontrol-test-result-edit-list-grid-productname', //url: limsQualitycontrolTestResult.baseUrl + '/queries/raw',
            service: 'limsQualitycontrolTestResultServiceImpl',
            dbTable: 'T_LIMS_QUALITYCONTROL_TEST_RESULT',
            columns: limsQualitycontrolTestResult.getDrawListColumns(),
            onCellClick: function (field, row) {
                field === 'id' && _this.loadDetailPage(row.id);
            },
            page: true,
            toolbar: [{
                type: 'button',
                text: 'GIKAM.SEARCH',
                icon: 'submit',
                onClick: function () {
                    var selections = Gikam.getComp('lims-qualitycontrol-test-result-edit-list-grid-productname').getSelections()
                    if (Gikam.isEmpty(selections)) {
                        Gikam.alert('GIKAM.TIP.CHOOSE_AT_LEAST_ONE_ITEM');
                        return
                    }
                    _this.selectDataByGroupChoose('productName')
                }
            }, {
                type: 'button',
                text: 'BUTTON.REMOVE.OUT-OF-THE-BOX.QUERIES',
                icon: 'submit',
                onClick: function () {
                    var selections = Gikam.getComp('lims-qualitycontrol-test-result-edit-list-grid-productname').getSelections()
                    if (Gikam.isEmpty(selections)) {
                        Gikam.alert('GIKAM.TIP.CHOOSE_AT_LEAST_ONE_ITEM');
                        return
                    }

                    var model = Gikam.create('modal', {
                        title: 'BUTTON.REMOVE.OUT-OF-THE-BOX.QUERIES',
                        height: '180',
                        width: '360',
                    });
                    Gikam.create('layout', {
                        renderTo: model.window.$dom,
                        center: {
                            items: [{
                                type: 'form',
                                id: 'select-adnormaltype-form',
                                fields: [{
                                    field: 'abnormalType',
                                    title: 'T_BATCH_ABNORMAL.ABNORMALREASON',
                                    type: 'select',
                                    firstBlank: false,
                                    multiple: true,
                                    validators: ['notEmpty']
                                }],
                                onLoadSuccess: function () {
                                },
                                onRendered: function () {
                                    var controlRuleSelectUrl = limsQualitycontrolTestResult.baseProjectUrl + '/controlrule-select'
                                    Gikam.postText(controlRuleSelectUrl, Gikam.getJsonWrapper(null, [null, null])).done(function (req) {
                                        if (req) {
                                            req = JSON.parse(req)
                                            var items = []
                                            req.items.forEach(function (i) {
                                                if (!i.text.includes('1-2S')) {
                                                    items.push(i)
                                                }
                                            })
                                            Gikam.getComp('select-adnormaltype-form').setSelectOptions('abnormalType', items)
                                        }
                                    })
                                },
                                columns: 1,
                                titleWidth: 120
                            }, {
                                type: 'btnToolbar',
                                items: [{
                                    type: 'button',
                                    text: 'GIKAM.BUTTON.CONFIRM',
                                    icon: 'save',
                                    onClick: function () {
                                        var form = Gikam.getComp('select-adnormaltype-form');
                                        if (form.validate()) {
                                            Gikam.getLastModal().close()
                                            _this.selectDataByGroupChoose('productName', true, form.getData().abnormalType)
                                        }
                                    }
                                }, {
                                    type: 'button',
                                    text: 'GIKAM.BUTTON.CANCEL',
                                    icon: 'cancel',
                                    onClick: function () {
                                        Gikam.getLastModal().close()
                                    }
                                }]
                            }]
                        }
                    })
                }
            }],
            group: {
                groupCheckbox: true,
                fields: ['productName'],
                formatter: function (row) {
                    return Gikam.propI18N("T_LIMS_QUALITYCONTROLPLAN_PROJECT.PRODUCTNAME") + '：' + row.productName
                }, expand: true
            },
            order: {'productName': 'desc'}
        }
    },

    getGridParamGroupByControlMaterialLevel: function () {
        var _this = this;
        return {
            type: 'grid',
            id: 'lims-qualitycontrol-test-result-edit-list-grid-controlmateriallevel', //url: limsQualitycontrolTestResult.baseUrl + '/queries/raw',
            service: 'limsQualitycontrolTestResultServiceImpl',
            dbTable: 'T_LIMS_QUALITYCONTROL_TEST_RESULT',
            columns: limsQualitycontrolTestResult.getDrawListColumns(),
            onCellClick: function (field, row) {
                field === 'id' && _this.loadDetailPage(row.id);
            },
            page: true,
            toolbar: [{
                type: 'button',
                text: 'GIKAM.SEARCH',
                icon: 'submit',
                onClick: function () {
                    var selections = Gikam.getComp('lims-qualitycontrol-test-result-edit-list-grid-controlmateriallevel').getSelections()
                    if (Gikam.isEmpty(selections)) {
                        Gikam.alert('GIKAM.TIP.CHOOSE_AT_LEAST_ONE_ITEM');
                        return
                    }
                    _this.selectDataByGroupChoose('controlMaterialLevel')
                }
            }, {
                type: 'button',
                text: 'BUTTON.REMOVE.OUT-OF-THE-BOX.QUERIES',
                icon: 'submit',
                onClick: function () {
                    var selections = Gikam.getComp('lims-qualitycontrol-test-result-edit-list-grid-controlmateriallevel').getSelections()
                    if (Gikam.isEmpty(selections)) {
                        Gikam.alert('GIKAM.TIP.CHOOSE_AT_LEAST_ONE_ITEM');
                        return
                    }
                    var model = Gikam.create('modal', {
                        title: 'BUTTON.REMOVE.OUT-OF-THE-BOX.QUERIES',
                        height: '180',
                        width: '360',
                    });
                    Gikam.create('layout', {
                        renderTo: model.window.$dom,
                        center: {
                            items: [{
                                type: 'form',
                                id: 'select-adnormaltype-form',
                                fields: [{
                                    field: 'abnormalType',
                                    title: 'T_BATCH_ABNORMAL.ABNORMALREASON',
                                    type: 'select',
                                    firstBlank: false,
                                    multiple: true,
                                    validators: ['notEmpty']
                                }],
                                onLoadSuccess: function () {
                                },
                                onRendered: function () {
                                    var controlRuleSelectUrl = limsQualitycontrolTestResult.baseProjectUrl + '/controlrule-select'
                                    Gikam.postText(controlRuleSelectUrl, Gikam.getJsonWrapper(null, [null, null])).done(function (req) {
                                        if (req) {
                                            req = JSON.parse(req)
                                            var items = []
                                            req.items.forEach(function (i) {
                                                if (!i.text.includes('1-2S')) {
                                                    items.push(i)
                                                }
                                            })
                                            Gikam.getComp('select-adnormaltype-form').setSelectOptions('abnormalType', items)
                                        }
                                    })
                                },
                                columns: 1,
                                titleWidth: 120
                            }, {
                                type: 'btnToolbar',
                                items: [{
                                    type: 'button',
                                    text: 'GIKAM.BUTTON.CONFIRM',
                                    icon: 'save',
                                    onClick: function () {
                                        var form = Gikam.getComp('select-adnormaltype-form');
                                        if (form.validate()) {
                                            Gikam.getLastModal().close()
                                            _this.selectDataByGroupChoose('controlMaterialLevel', true, form.getData().abnormalType)
                                        }
                                    }
                                }, {
                                    type: 'button',
                                    text: 'GIKAM.BUTTON.CANCEL',
                                    icon: 'cancel',
                                    onClick: function () {
                                        Gikam.getLastModal().close()
                                    }
                                }]
                            }]
                        }
                    })
                }
            }],
            group: {
                groupCheckbox: true, fields: ['controlMaterialLevel'], formatter: function (row) {
                    return Gikam.propI18N("T_LIMS_QUALITYCONTROL_TEST_RESULT.CONTROLMATERIALLEVEL") + '：' + row.ext$.codename
                }, expand: true
            },
            order: {'controlMaterialLevel': 'desc'}
        }
    },

    selectDataByGroupChoose: function (gridType, ifKickAbnomalData, abnormalType) {
        var _this = this
        var selections
        if (!ifKickAbnomalData) {
            ifKickAbnomalData = false
        }
        if (!gridType || gridType == 'productName') {
            selections = Gikam.getComp('lims-qualitycontrol-test-result-edit-list-grid-productname').getSelections()
        } else {
            selections = Gikam.getComp('lims-qualitycontrol-test-result-edit-list-grid-controlmateriallevel').getSelections()
        }
        workspace.window.showMask();
        var selectUrl = limsQualitycontrolTestResult.baseUrl + '/saveto-managetable'
        var searchForm = Gikam.getComp('search-form').getData()
        var extraData = {
            fromDate: searchForm.fromDate,
            toDate: searchForm.toDate,
            professionalGroup: searchForm.professionalGroup,
            equipName: searchForm.equipName,
            ifKickAbnomalData: ifKickAbnomalData,
            abnormalType: abnormalType
        }

        Gikam.postText(selectUrl, Gikam.getJsonWrapper(null, [null, selections], [null, [extraData]])).done(function (req) {
            Gikam.getAsyncComp('lims-qualitycontrol-test-result-manage-edit-list-grid').done(function (grid) {
                grid.refresh({
                    url: limsQualitycontrolTestResult.baseManageUrl + '/queries', requestData: {
                        createdById_EQ: workspace.user.id,
                        selectLatestByUserId: workspace.user.id,
                    }
                });
            })
            Gikam.getAsyncComp('lims-qualitycontrol-test-result-groupdata-list-grid').done(function (grid) {
                grid.refresh({
                    url: limsQualitycontrolTestResult.baseManageUrl + '/queries-distinctrows',
                    requestData: {
                        createdById_EQ: workspace.user.id,
                        selectLatestByUserId: workspace.user.id,
                    }
                });
            })

            req = JSON.parse(req)
            if (req.sourceList) {
                Gikam.getAsyncComp('echarts-main').done(function (chart) {
                    _this.datas.baseChartData.sourceList = req.sourceList
                    chart.setOption(_this.formatOption(_this.datas.baseChartData), true)
                })
            }
        }).always(function () {
            workspace.window.closeMask()
        })
    },

    refreshGroupGrids: function () {
        var searchForm = Gikam.getComp('search-form').getData()
        const fromDate = searchForm.fromDate
        const toDate = searchForm.toDate
        const professionalGroup = searchForm.professionalGroup
        const equipName = searchForm.equipName

        if (fromDate && toDate && professionalGroup && equipName) {
            Gikam.getAsyncComp('lims-qualitycontrol-test-result-edit-list-grid-productname').done(function (grid) {
                grid.refresh({
                    url: limsQualitycontrolTestResult.baseUrl + '/selectdistinctrows', requestData: {
                        professionalGroup_EQ: professionalGroup,
                        equipmentName_EQ: equipName,
                        resultSaveTime_TGOE: fromDate,
                        resultSaveTime_TLOE: toDate,
                        status_EQ: '1'
                    }
                })
            })
            Gikam.getAsyncComp('lims-qualitycontrol-test-result-edit-list-grid-controlmateriallevel').done(function (grid) {
                grid.refresh({
                    url: limsQualitycontrolTestResult.baseUrl + '/selectdistinctrows', requestData: {
                        professionalGroup_EQ: professionalGroup,
                        equipmentName_EQ: equipName,
                        resultSaveTime_TGOE: fromDate,
                        resultSaveTime_TLOE: toDate,
                        status_EQ: '1'
                    }
                })
            })
        }
    },

    getSearchForm: function () {
        var _this = this
        return {
            type: 'form',
            id: 'search-form',
            fields: [{
                field: 'fromDate',
                title: 'T_LIMS_QUALITYCONTROL_TEST_RESULT.FROMDATE',
                type: 'dateTime',
                onChange: function (field, value, rowIndex, oldValue, text) {
                    const fromDate = Gikam.getComp('search-form').getData().fromDate
                    const toDate = Gikam.getComp('search-form').getData().toDate
                    if (fromDate && toDate) {
                        Gikam.postText(limsQualitycontrolTestResult.baseUrl + '/getchosable-professionalgroup', Gikam.getJsonWrapper(null, ['', [{
                            fromDate: fromDate, toDate: toDate
                        }]])).done(function (data) {
                            data = JSON.parse(data)
                            var professionalGroups = data.professionalGroups
                            if (data.professionalGroups) {
                                var values = data.professionalGroups.map(row => row.value).join(",")
                                Gikam.postText(IFM_CONTEXT + '/secure/core/module/sys/codes/queries', Gikam.getJsonWrapper({
                                    f: {
                                        code_IN: values, codeCategoryId_EQ: 'qualityControl-professionalGroup'
                                    }
                                })).done(function (req) {
                                    req = JSON.parse(req)
                                    if (!Gikam.isEmpty(req.rows)) {
                                        professionalGroups = req.rows.map(function (item) {
                                            return {
                                                text: item.codeName, value: item.code
                                            }
                                        })
                                        Gikam.getComp('search-form').setSelectOptions('professionalGroup', professionalGroups)
                                    }
                                })
                            } else {
                                Gikam.getComp('search-form').setSelectOptions('professionalGroup', professionalGroups)
                            }
                            Gikam.getComp('search-form').setSelectOptions('equipName', data.equipNames)
                        })
                    }
                }
            }, {
                field: 'toDate',
                title: 'T_LIMS_QUALITYCONTROL_TEST_RESULT.TODATE',
                type: 'dateTime',
                onChange: function (field, value, rowIndex, oldValue, text) {
                    const fromDate = Gikam.getComp('search-form').getData().fromDate
                    const toDate = Gikam.getComp('search-form').getData().toDate
                    if (fromDate && toDate) {
                        Gikam.postText(limsQualitycontrolTestResult.baseUrl + '/getchosable-professionalgroup', Gikam.getJsonWrapper(null, ['', [{
                            fromDate: fromDate, toDate: toDate
                        }]])).done(function (data) {
                            data = JSON.parse(data)
                            Gikam.getComp('search-form').setSelectOptions('professionalGroup', data.professionalGroups)
                            Gikam.getComp('search-form').setSelectOptions('equipName', data.equipNames)
                        })
                    }
                }
            }, {
                field: 'professionalGroup',
                title: 'T_LIMS_QUALITYCONTROL_TEST_RESULT.PROFESSIONALGROUP',
                type: 'select',
                onChange: function (field, value, rowIndex, oldValue, text) {
                    _this.refreshGroupGrids()
                }
            }, {
                field: 'equipName',
                title: 'T_LIMS_QUALITYCONTROL_TEST_RESULT.EQUIPMENTNAME',
                type: 'select',
                onChange: function (field, value, rowIndex, oldValue, text) {
                    _this.refreshGroupGrids()
                }
            }],
            columns: 4,
            titleWidth: 80
        }
    },

    getGridTab: function () {
        var _this = this;
        return {
            type: 'tab', id: 'main-tab', panels: [{
                title: 'T_LIMS_QUALITYCONTROL_TEST_RESULT.GROUPBYPRODUCT',
                id: 'lims-batch-tab-not-productcode',
                items: [_this.getGridParamGroupByProductCode()]
            }, {
                title: 'T_LIMS_QUALITYCONTROL_TEST_RESULT.GROUPBYLEVEL',
                id: 'lims-batch-tab-controlmateriallevel',
                items: [_this.getGridParamGroupByControlMaterialLevel()]
            }]
        }
    },

    loadDetailPage: function (id) {
        workspace.window.load(limsQualitycontrolTestResult.baseUrl + '/page/detail' + Gikam.param({
            id: id
        }));
    },

    saveGridData: function () {
        var _this = this
        var manageGridData = Gikam.getComp('lims-qualitycontrol-test-result-manage-edit-list-grid').getData()
        if (!manageGridData || Gikam.isEmpty(manageGridData)) {
            return
        }

        workspace.window.showMask();
        var data = {
            createdById: workspace.user.id,
            groupByCreaterAndId: manageGridData[0].groupByCreaterAndId
        }
        var saveUrl = limsQualitycontrolTestResult.baseManageUrl + '/saveto-managesavetable'

        Gikam.postText(saveUrl, Gikam.getJsonWrapper(data, [null, null])).done(function (req) {
            Gikam.alert('CORE.MODULE.TOPOLOGY.MODAL.TIP.TOPOLOGY_DESIGN_SAVED')
        }).always(function () {
            workspace.window.closeMask()
        })
    },

    setRemoveStatus: function (removeStatus) {
        var _this = this
        var selections = Gikam.getComp('lims-qualitycontrol-test-result-manage-edit-list-grid').getSelections()
        if (Gikam.isEmpty(selections)) {
            return
        }
        Gikam.confirm('GIKAM.MODAL.SUBMIT', 'GIKAM.TIP.SUBMIT', function () {
            workspace.window.showMask();
            var data = {
                removeStatus: removeStatus
            }
            var saveUrl = limsQualitycontrolTestResult.baseManageUrl + '/set-removestatus'

            Gikam.postText(saveUrl, Gikam.getJsonWrapper(data, [null, selections])).done(function (req) {
                Gikam.alert('CORE.MODULE.TOPOLOGY.MODAL.TIP.TOPOLOGY_DESIGN_SAVED')
            }).always(function () {
                Gikam.getComp('lims-qualitycontrol-test-result-manage-edit-list-grid').refresh()
                workspace.window.closeMask()
            })
        })
    },

    getManageGridParam: function () {
        var _this = this;
        return {
            type: 'grid',
            id: 'lims-qualitycontrol-test-result-manage-edit-list-grid', // url: limsQualitycontrolTestResult.baseManageUrl + '/queries',
            service: 'limsQualitycontrolTestResultManageServiceImpl',
            dbTable: 'T_LIMS_QUALITYCONTROL_TEST_RESULT_MANAGE',
            columns: limsQualitycontrolTestResult.getManageEditListColumns(),
            page: true,
            onLoadSuccess: function (data) {
            },
            onRowActive: function (index, row) {
            },
            editor: true,
            group: {
                fields: ['mainBatchCode', 'controlMaterialLevel', 'productName'],
                formatter: function (row) {
                    return Gikam.propI18N("T_LIMS_QUALITYCONTROL_TEST_RESULT.MAINBATCHCODE") + '：'
                        + row.mainBatchCode + ' ' + Gikam.propI18N("T_LIMS_QUALITYCONTROL_TEST_RESULT.CONTROLMATERIALLEVEL") + '：'
                        + row.ext$.codename + ' ' + Gikam.propI18N("T_LIMS_QUALITYCONTROLPLAN_PROJECT.PRODUCTNAME") + '：' + row.productName
                },
                expand: true
            },
            order: {
                'mainBatchCode': 'asc',
                'controlMaterialLevel': 'asc',
                'productName': 'asc',
                'resultSaveTime': 'desc'
            },
            toolbar: [{
                type: 'button',
                text: 'GIKAM.BUTTON.SAVE',
                icon: 'save',
                onClick: function () {
                    _this.saveGridData()
                }
            }, {
                type: 'button',
                text: 'GIKAM.BUTTON.RemoveStatus.SetToYes',
                icon: 'disable',
                onClick: function () {
                    _this.setRemoveStatus('1')
                }
            }, {
                type: 'button',
                text: 'GIKAM.BUTTON.RemoveStatus.SetToNo',
                icon: 'enable',
                onClick: function () {
                    _this.setRemoveStatus('0')
                }
            }],
        }
    },

    formatXdata: function (list) {
        var xdata = [];   //X轴数据
        if (list.length) {
            list[0].forEach(function (item) {
                xdata.push(item.dateTime);
            })
        }
        return xdata;
    },
    // 判断Y轴数据最大值
    getMaxValue: function (list, key) {
        key = key || "";
        var tempList = [];
        list.forEach(function (item) {
            item = item || [];
            item.forEach(function (obj) {
                var value = +obj[key];
                tempList.push(value)
            })
        })
        return Math.ceil(Math.max.apply(null, tempList));
    },
    // 格式化Y轴数据及其他内容
    formatYdata: function (list) {
        var ydata = [];   //Y轴数据
        if (list.length) {
            // 根据数据计算Y轴最大值
            const maxVal = this.getMaxValue(list, "observation");
            this.yAxisMax = (maxVal < 8) ? 8 : maxVal;
            //格式化
            list.forEach(function (item) {
                var tmpArr = [];
                item.forEach(function (val) {
                    var tpmObj = {};
                    val.observation = val.observation || 0;
                    tpmObj.value = val.observation;
                    tpmObj.desc = val.description;
                    tpmObj.lineName = val.name;
                    tpmObj.isNormal = val.isNormal;   //异常点
                    tmpArr.push(tpmObj);
                })
                ydata.push(tmpArr);
            })
        }
        return ydata;
    },
    // 格式化标示线数据
    formatMarklineData: function (list) {
        var marklineData = [];   //标示线数据
        list.map(function (item) {
            item.lineStyle.type = "dashed";   //虚线
            item.yAxis = item.lineData;   //横标线
            return item;
        })
        marklineData = list;
        return marklineData;
    },
    // 格式化series
    formatSeries: function (dataList) {
        var seriesData = [];   //series数据
        var marklineData = this.formatMarklineData(dataList.markLineList);
        //markline渲染数据
        var marklineOption = {
            symbol: "none",
            emphasis: {
                disabled: true
            },
            silent: true,
            label: {
                fontSize: 16,
                formatter: "{b}"
            },
            data: marklineData
        };
        //格式化渲染选项
        if (dataList.sourceList.length) {
            var ydata = this.formatYdata(dataList.sourceList);
            ydata.forEach(function (item) {
                var tmpObj = {
                    type: "line",
                    symbolSize: 6,
                    symbol: function (value, params) {   //异常点用三角标识
                        if (params.data.isNormal) {
                            return "circle";
                        } else {
                            return "triangle";
                        }
                    },
                    itemStyle: {
                        color: function (params) {
                            if (params.data.isNormal) {   //异常点用红色标识
                                return params.color;
                            } else {
                                return "red";
                            }
                        }
                    }
                }
                tmpObj.data = item;
                item.forEach(function (val) {
                    tmpObj.name = val.lineName;
                })
                seriesData.push(tmpObj);
            })
            seriesData.length && (seriesData[0].markLine = marklineOption);
        } else {
            this.yAxisMax = 8;
            seriesData = [{
                type: "line",
                markLine: marklineOption
            }]
        }
        return seriesData;
    },
    // 格式化走势图选项
    formatOption: function (dataList) {
        var xdata = this.formatXdata(dataList.sourceList);
        var seriesData = this.formatSeries(dataList || []);
        var option = {
            color: ['#73C0DE', '#91cc75', '#fac858', '#F9B090', '#cd5fff', '#A3CDDF', '#54D094', '#D99F1D', '#fc8452', '#FC8452'],
            tooltip: {
                trigger: "axis",
                textStyle: {
                    fontSize: 12
                },
                formatter: function (params) {
                    var str = '';
                    if (params.length) {
                        str = '<table><tr><td>' + params[0].name + '</td></tr>';
                        params.forEach(function (item) {
                            str += '<tr><td>' + item.seriesName + '：</td><td style="color:' + item.color + '">' + item.data.desc + '</td></tr>';
                        })
                        str += '</table>';
                    }
                    return str;
                }
            },
            grid: {
                left: "3%",
                bottom: 90
            },
            legend: {
                show: true
            },
            xAxis: [{
                type: "category",
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#ccc"
                    }
                },
                axisLabel: {
                    show: true,
                    color: "#999",
                    interval: 0,
                    rotate: -60
                },
                axisTick: {
                    alignWithLabel: true
                },
                data: xdata
            }],
            yAxis: [{
                type: "value",
                min: 0,
                max: this.yAxisMax,
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#ccc"
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    show: false
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: "#ccc"
                    }
                }
            },
                {
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: "#ccc"
                        }
                    },
                    axisTick: {
                        show: false
                    },
                    axisLabel: {
                        show: false
                    },
                    splitLine: {
                        show: false
                    },
                    inverse: true
                }],
            dataZoom: [
                {
                    type: "inside",
                    start: 0,
                    end: 100
                },
                {
                    start: 0,
                    end: 100
                }
            ],
            series: seriesData
        }
        return option;
    },

    getLJChart: function () {
        var _this = this
        return {
            type: 'LJ-chart',
            id: 'LJ-chart-form',
            dataInfo: _this.datas.baseChartData
        }
    },

    //右下角的分组后明细表
    getManageReultDataByGroup: function () {
        var gridStruct = {
            type: 'grid',
            id: 'lims-qualitycontrol-test-result-groupdata-list-grid',
            // url: limsQualitycontrolTestResult.baseManageUrl + '/queries-distinctrows',
            service: 'limsQualitycontrolTestResultManageServiceImpl',
            dbTable: 'T_LIMS_QUALITYCONTROL_TEST_RESULT_MANAGE',
            columns: limsQualitycontrolTestResult.getManageReultDataByGroupListColumns(),
            onLoadSuccess: function (data) {
            },
            onRowActive: function (index, row) {
            },
            requestData: {
                createdById_EQ: workspace.user.id,
                selectLatestByUserId: workspace.user.id,
            }
        }
        return gridStruct
    },

    create: function () {
        var _this = this;
        Gikam.create('layout', {
            id: 'lims-qualitycontrol-test-result-edit-list-layout',
            renderTo: workspace.window.$dom,
            north: {
                height: 40,
                items: [_this.getSearchForm()]
            },
            west: {
                width: '25%',
                items: [_this.getGridTab()]
            },
            center: {
                items: [{
                    type: 'tab',
                    panels: [{
                        title: 'BASELINE.BASEDATA.QUALITYCONTROLRESULTS.DRAWING',
                        items: [_this.getLJChart()]
                    }, {
                        title: 'BASELINE.BASEDATA.QUALITYCONTROLRESULTS.TITLE.GRIDTITLE',
                        items: [{
                            type: 'layout',
                            north: {
                                height: '60%',
                                items: [_this.getManageGridParam()]
                            }, center: {
                                items: [_this.getManageReultDataByGroup()]
                            }
                        }],

                    }]
                }]
            }
        })
    },

    init: function () {
        this.create();
    }
};
